import config from "@/config"
import http from "@/utils/request"

export default {
	refreshcode: {
		url: `${config.API_URL}/auth/refresh`,
		name: "过期刷新授权码",
		put: async function (params) {
			return await http.put(this.url, params);
		}
	},
	imgcode: {
		url: `${config.API_URL}/captcha/image-code`,
		name: "获取图形验证",
		get: async function (params) {
			return await http.get(this.url, params);
		}
	},
	imgcodeverify: {
		url: `${config.API_URL}/auth/verify-captcha`,
		name: "验证图形验证码",
		get: async function (params) {
			return await http.get(this.url, params);
		}
	},
	token: {
		url: `${config.API_URL}/auth`,
		name: "登录获取TOKEN",
		get: async function (params) {
			return await http.get(this.url, params);
		}
	},
	user: {
		url: `${config.API_URL}/auth/user`,
		name: "获取当前登录人的信息",
		get: async function (params = {}) {
			return await http.get(this.url, params);
		}
	},
	pass: {
		url: `${config.API_URL}/auth/password`,
		name: "修改密码",
		put: async function (params = {}) {
			return await http.put(this.url, params);
		}
	},
}
